import FormAction from '../../../src/components/ConfigForm/Action';

export default class extends FormAction {
    savePro = () => {
        const [data, currentRowIndex] = this.models.proInfoM.get(['formData', 'currentRowIndex']);
        const list = this.models.projectListM.get('data');

        let rowData = {
            name: data.projectName,
            gitUrl: data.gitUrl,
            developer: data.developer,
            detail: data.detail,
            endLine: data.endLine
        };

        list[currentRowIndex] = rowData;

        this.models.projectListM.set({
            data: list
        });
        this.models.pageM.set({
            page: 'list'
        });
    }
}